/* varwidth.c -- 更灵活的转换说明 */

#include <stdio.h>

int main(void)
{
  unsigned width, precision;
  int num = 256;
  double weight = 242.5;

  printf("Enter the width: ");
  scanf("%u", &width);
  printf("The num is %0*d.\n", width, num);

  printf("Then enter the precision of weight: ");
  scanf("%u", &precision);
  printf("The weight is %*.*f.\n", width, precision, weight);
  
  return 0;
}